﻿// Type: System.Web.Mvc.ControllerBase
// Assembly: System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// Assembly location: C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll

using System.Web.Routing;

namespace System.Web.Mvc
{
    /// <summary>
    /// Represents the base class for all MVC controllers.
    /// </summary>
    public abstract class ControllerBase : IController
    {
        /// <summary>
        /// Executes the specified request context.
        /// </summary>
        /// <param name="requestContext">The request context.</param><exception cref="T:System.ArgumentNullException">The <paramref name="requestContext"/> parameter is null.</exception>
        protected virtual void Execute(RequestContext requestContext);

        /// <summary>
        /// Executes the request.
        /// </summary>
        protected abstract void ExecuteCore();

        /// <summary>
        /// Initializes the specified request context.
        /// </summary>
        /// <param name="requestContext">The request context.</param>
        protected virtual void Initialize(RequestContext requestContext);

        /// <summary>
        /// Executes the specified request context.
        /// </summary>
        /// <param name="requestContext">The request context.</param>
        void IController.Execute(RequestContext requestContext);

        /// <summary>
        /// Gets or sets the controller context.
        /// </summary>
        /// 
        /// <returns>
        /// The controller context.
        /// </returns>
        public ControllerContext ControllerContext { get; set; }

        /// <summary>
        /// Gets or sets the dictionary for temporary data.
        /// </summary>
        /// 
        /// <returns>
        /// The dictionary for temporary data.
        /// </returns>
        public TempDataDictionary TempData { get; set; }

        /// <summary>
        /// Gets or sets a value that indicates whether request validation is enabled for this request.
        /// </summary>
        /// 
        /// <returns>
        /// true if request validation is enabled for this request; otherwise, false. The default is true.
        /// </returns>
        public bool ValidateRequest { get; set; }

        /// <summary>
        /// Gets or sets the value provider for the controller.
        /// </summary>
        /// 
        /// <returns>
        /// The value provider for the controller.
        /// </returns>
        public IValueProvider ValueProvider { get; set; }

        /// <summary>
        /// Gets the dynamic view data dictionary.
        /// </summary>
        /// 
        /// <returns>
        /// The dynamic view data dictionary.
        /// </returns>
        public dynamic ViewBag { get; }

        /// <summary>
        /// Gets or sets the dictionary for view data.
        /// </summary>
        /// 
        /// <returns>
        /// The dictionary for the view data.
        /// </returns>
        public ViewDataDictionary ViewData { get; set; }
    }
}
